﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderCardExport.aspx.cs"
    Inherits="CardLogistics.Web.MainPage.Ordering.Ordering_Cardinfo.OrderCardExport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>导出卡片订货单</title>
    <link href="../../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/selPage.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../../js/jquery.js"></script>
    <script src="../../../js/jquery.tipswindow.2.0.js" type="text/javascript"></script>
    <script src="../../../js/valReq.js" type="text/javascript"></script>
    <script src="../../../js/tblistjs.js" type="text/javascript"></script>
    <script src="../../../js/CreateControl.js" type="text/javascript"></script>
    <script type="text/javascript">
        function OnInitialize() {
            var ReportViewer = document.getElementById("ReportViewer");
            var Report = ReportViewer.Report;
            var atturls = Report.FieldByName("ATTURL").AsString.toString().split(',');
            for (var i = 0; i < atturls.length; i++) {
                if (i == 0) {
                    var PathFile = "../../File/Upload/" + atturls[i].split('|')[1].toString();
                    Report.ControlByName("PictureBox2").AsPictureBox.LoadFromFile(PathFile);
                    //在报表中的一个文字框中显示出来
                    Report.ControlByName("txt2").AsStaticBox.Text = "1." + atturls[i].split('|')[0].toString();
                }
                else if (i == 1) {
                    var PathFile = "../../File/Upload/" + atturls[i].split('|')[1].toString();
                    Report.ControlByName("PictureBox3").AsPictureBox.LoadFromFile(PathFile);
                    //在报表中的一个文字框中显示出来
                    Report.ControlByName("txt3").AsStaticBox.Text = "2." + atturls[i].split('|')[0].toString();
                }
                else if (i == 2) {
                    var PathFile = "../..File/Upload/" + atturls[i].split('|')[1].toString();
                    Report.ControlByName("PictureBox4").AsPictureBox.LoadFromFile(PathFile);
                    //在报表中的一个文字框中显示出来
                    Report.ControlByName("txt4").AsStaticBox.Text = "3." + atturls[i].split('|')[0].toString();
                } 
            }
        }
        function window_onload() {
            var ReportViewer = document.getElementById("ReportViewer");
            ReportViewer.Stop();

            var Report = ReportViewer.Report;
            Report.OnInitialize = OnInitialize;

            //启动报表运行
            ReportViewer.Start();
        }
    </script>
</head>
<body onload="return window_onload()">
    <form runat="server" id="f2">
    <div class="rightinfo">
        <asp:HiddenField ID="hf_orderId" runat="server" />
        <script type="text/javascript">
            var divkuangH = $(window).height();
            var viewH = divkuangH - 117 + 100 - 1;
            var orderId =document.all.<%=hf_orderId.ClientID%>.value;
            var url = "OrderCardExportRpt.aspx?orderId="+orderId;
            CreatePrintViewerEx("100%", viewH, '../../../grf/OrderCardExport.grf', url, true, "");
        </script>
    </div>
    </form>
</body>
</html>
